package teshop.data.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Item in the shopping cart (including quantity)
 * 
 * @author Hryhory Lira
 *
 */
@SuppressWarnings("serial")
@Entity
@Table(name="LINE_ITEM")
public class LineItem implements Serializable {
	
	@Id
	@GeneratedValue
	@Column(name="LINE_ITEM_ID")
	private Integer id;
	
	private Integer quantity;
	
	@ManyToOne
	@JoinColumn(name="ORDER_ID")
	private Order order;
	
	@ManyToOne
	@JoinColumn(name="PRODUCT_ID")
	private Product item;

	public LineItem() {
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getQuantity() {
		return quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	public Product getItem() {
		return item;
	}

	public void setItem(Product item) {
		this.item = item;
	}

	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

}
